package thrift;

import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TSimpleServer;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TServerTransport;
import org.apache.thrift.transport.TTransportException;
import tutorial.Calculator;

/**
 * Created with IntelliJ IDEA.
 * MyUser: belict
 * Date: 11/30/13
 * Time: 6:22 PM
 * To change this template use File | Settings | File Templates.
 */
public class Server {
    public static void main(String[] args) throws TTransportException {
        CalculatorHandler calculatorHandler = new CalculatorHandler();
        Calculator.Processor processor = new Calculator.Processor(calculatorHandler);

        TServerTransport tServerTransport = new TServerSocket(9090);
        TServer server = new TSimpleServer(new TServer.Args(tServerTransport).processor(processor));

        System.out.println("Starting the simple server");
        server.serve();

    }
}
